package com.kanas.webak.rbac.service;

import java.util.List;
import java.util.Set;

import com.kanas.webak.rbac.domain.AppPermission;
import com.kanas.webak.rbac.domain.AppRole;
import com.kanas.webak.rbac.domain.AppUserRole;

public interface AppRoleService {
	List<AppRole> findAll();
	List<AppRole> findAllExceptAdmin();
	AppRole findOne(String roleId);
	String update(String roleId,AppRole role);
	String removeFromUser(String roleId,String userId);
	AppRole addNew(AppRole role) throws Exception;
	String delete(String roleId) throws Exception;
	List<AppPermission> listFunction(String roleId);
	void savePermission(String roleId,String permissionIds);
	Set<AppRole> findByUserId(String userId);
	List<AppRole> findByEnableFlag(boolean enableFlag);
	List<AppRole> findByExportFlagAndEnableFlag(boolean exportFlag, boolean enableFlag);
	List<AppRole> inclusionRole(String id);
	String operateInclusionRole(String rid, String id, boolean flag);
	List<AppPermission> findPermissions(String rid) throws Exception;
	List<AppUserRole> findUserRoles(String id) throws Exception;
	String newPermission(String rid, String pid) throws Exception;
	String removePermission(String pid);
	String removeUser(String uid);
	String newUserRole(String rid, String oid, String uid) throws Exception;
	List<AppRole> findRoles(String type);
}
